from app import BASE_URL
import requests

class TenderApi:

    def __init__(self, session):
        # 实名认证url
        self.tender_url = BASE_URL + "/trust/trust/tender"
        self.session = session

    def get_tender(self, id, amount):
        param = {
            "id": id,
            "depositCertificate": -1,
            "amount": amount
        }

        return self.session.post(self.tender_url, data=param)



if __name__ == '__main__':
    session = requests.session()
    r = TenderApi(session).get_tender(2043,500)
    print(r.json())
